Generating TLX Reports

A TLX report is a model validation report that uses erwin Template Language (TLX). Report Designer includes some default validation reports and also lets you configure new reports with custom properties. You must be familiar with erwin Template Language (TLX) to configure new reports.

When you configure new reports, you can add two types of custom properties, filters and TLX properties. The code for a filter includes a function that returns TRUE or FALSE.

Generate a Default TLX Report

Report Designer includes default TLX reports at entity/table, attribute/column, domain, and relationship level. Some of the properties that are included in the default TLX reports are no definition or no primary key. This topic describes how you can create an entity/table level report as an example. You can create other TLX reports on the same lines as described in the procedure.

To create an entity/table level report, follow these steps:

  1. Click Tools, Report Designer, Create a new report.
  2. Select Logical/Physical for Report Type.
  3. Click Entity/Table in the Select Report Subject pane.
  4. In the Select Report Fields pane, expand Filter By and select the No Definition and No Comment check boxes.
  5. Expand Properties and select Name, Physical Name check boxes.
  6. Click Run Report.

    The list of entities and tables that do not have a definition or a comment is displayed.

Create a Custom TLX Report

If you are familiar with TLX scripting, you can add your own functions for properties of your choice and configure custom reports. For example, you can create a report that gives the number of attributes in each entity. You can add two types of custom properties, filters and TLX properties. The code for a filter includes a function that returns TRUE or FALSE.

To configure a new report, you must modify the following configuration files:

  • TLXReportAssembly.xml
  • TLXReportTemplate.FET

These files are available in the <erwin install folder>\Report\TLX folder.

Follow these steps to create a custom TLX report:

  1. Modify the TLXReportAssembly.xml file and include the TLX property that you want to report on.
  2. Modify the TLXReportTemplate.FET file and include the function for the custom property.
  3. Restart erwin Data Modeler.
  4. Create a report in the Report Designer and select the TLX property that you have added.
  5. Run the report.

Modify the TLXReportAssembly File

To display a property under the Filter By node or the Property node in the Report Designer, you must add an entry for the property in the TLXReportAssembly file.

The TLXReportAssembly.xml file includes the following parameters:

Assembly ID

Specifies the unique identifier for the property entry in the TLXReportAssembly file. You can enter any number of your choice, as long as it is unique within this file.

OwnerID

Specifies the owner ID for the object for which you want to create a custom property. Use the following owner IDs:

Owner ID

Object

1075838979

Entity/Table

1075838981

Attribute/Column

1075838983

Domain

1075839016

Relationship

1075838985

Key Group

Name

Specifies the name of the custom property the way it appears in the Report Designer.

ExtractType

Specifies the type of report for which the custom property is available. 1 denotes Logical, 2 denotes Physical, and 3 denotes Logical/Physical.

DBMS Info

Specifies the database for which the custom property applies. Enter the information in the format, "database brand code, major version number of the database, minor version of the database."

A value of "0,0,0" indicates that the custom property applies to all databases. The following table provides the DBMS information for the databases that the current release supports:

Database

DBMS Info in TLXAssembly

DB2 for i 5.x/6.x/7.x

(1075859019,4,0)

DB2 for LUW 9.5

(1075858977,9,5)

DB2 for LUW 9.7/10.x

(1075858977,9,7)

DB2 for z/OS 8.1

(1075858978,8,1)

DB2 for z/OS 9.1/10/11

(1075858978,9,1)

DB2 for z/OS 12

(1075858978,12,0)

Hive 2.1.x

(1075859187,2,1)

Informix 10.x/11.x/12.x

(1075859006,9,2)

MySQL 5.x

(1075859129,5,0)

Netezza

(1075918978,7,2)

ODBC/Generic 2.x

(1075859009,2,0)

ODBC/Generic 3.x

(1075859009,3,0)

Oracle 10g

(1075858979,10,0)

Oracle 11g/12c

(1075858979,11,0)

PostgreSQL 9.6

(1075918977,9,6)

Progress 9.x/10.x/11.x

(1075859010,9,0)

SAS

(1075859013,1,0)

SAP ASE 15.x/16

(1075859017,12,5)

SAP IQ 15.x/16

(1075859130,15,0)

SQL Azure

(1075859180,10,25)

SQL Server 2008

(1075859016,10,0)

SQL Server 2012

(1075859016,11,0)

SQL Server 2014

(1075859016,12,0)

SQL Server 2016/2017

(1075859016,13,0)

Teradata 14.10

(1075859018, 14, 10)

Teradata 15.x/16.x

(1075859018, 15, 0)

TLXFunction

Specifies the TLX function name for the custom property. The function name can be any name that describes the property.

Is Filter

Specifies whether the custom property is a filter or a property. Include a value of 1 for filter and 0 for property. If you include 1, the property is displayed under the Filter by node of the corresponding object. If you include 0, the property is displayed under the Properties node of the object in Report Designer.

Follow these steps:

  1. Open the TLXReportAssembly.xml file in a text editor such as Notepad.
  2. Add a line for the property that you want to include in the report.
  3. Save the file.

Modify the TLXReportTemplate.FET File

The TLXReportTemplate.FET file includes the functions that help the Report Designer generate the report for a TLX property. You must modify the file to include the function for a custom property for which you want to generate a report.

Note: Use the same function name in the TLXReportAssembly and TLXReportTemplate files.

Follow these steps:

  1. Open the TLXReportTemplate.FET file in a text editor such as Notepad.
  2. Add the TLX script for the property that you want to include in the report.
  3. Save the file.

    Now the custom property appears in the Report Designer under the corresponding node. You can include the property in a report.

Example--Number of Attributes in an Entity

This example demonstrates how you can generate a report on the custom property Number of Attributes in an Entity. This property is of type TLX property.

Follow these steps:

  1. Add an entry to the TLXReportAssembly.xml file to create a node for Number of Attributes in Report Designer.
  2. Add the TLX function NumberofAttributes to the TLXReportTemplate.FET file.
  3. Create a report and include the Number of Attributes property.

Add an Entry to the TLXReportAssembly.xml File

Follow these steps:

  1. Open the TLXReportAssembly.xml file from the <erwin install folder>\Report\TLX folder.
  2. Add the following entry and save the file:
    <Assembly Id="1002"  OwnerId="1075838979" Name="Number of Attributes" ExtractType="1" DBMSInfo="0, 0, 0" TLXFunction="NumberofAttribute" IsFilter="0"/>
    

Add the TLX Function NumberofAttributes to the TLXReportTemplate.FET File

Follow these steps:

Add the following code to the TLXReportTemplate.FET file and save the file:

SPItemBegin = NumberofAttribute
[
	Set("Count", 0)
	ForEachOwnee("Attribute")
	{
		Increment("Count")
	}
	Value("Count")
]
SPItemEnd

Number of Attributes is added to Report Designer under Entity, Properties.

Create a Report and Include the Number of Attributes Property

Follow these steps:

  1. Open Report Designer.
  2. Select the Report Type as Logical.
  3. In the Select Report Subject pane, select Entity.
  4. In the Select Report Fields pane, expand Entity, Properties, and select Name, Number of Attributes.
  5. Click Run Report.